# coding=utf-8
from flask import jsonify, request
from app import route_api
from app.service.api.game import *
from app.service.api.match import *
page_name = "match"


@route_api.my_route(page_name, "/show", methods=["POST"])
def match_show():
    result = show_service()
    return jsonify(result)


@route_api.my_route(page_name, "/enterroom", methods=["POST"])
def match_enterroom():
    token = request.headers.get("token")
    token = token if token else ""
    result = enterroom_service(token)
    print(result)
    return jsonify(result)